Skip to content

Issue 3938 Improve MCP SSE URL configuration documentation and examples #3953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wilocu
Copy link
Contributor

@wilocu wilocu commented Jul 31, 2025

Summary

This PR addresses the confusion around splitting complex MCP SSE URLs into the required url and sse-endpoint properties. The
functionality already worked correctly, but users lacked clear examples and guidance on how to properly configure complex URLs
like http://localhost:3000/mcp-hub/sse/cf9ec4527e3c4a2cbb149a85ea45ab01.

Changes
Enhanced Documentation:

  • JavaDoc improvements in McpSseClientProperties.java with comprehensive URL splitting examples
  • AsciiDoc documentation in mcp-client-boot-starter-docs.adoc with real-world configuration examples
  • URL splitting guidelines table showing how to split various URL patterns
  • Troubleshooting section for common 404 errors

Test Coverage:

  • Added mcpHubStyleUrlWithTokenPath() test in McpSseClientPropertiesTests.java
  • Validates the exact URL pattern from the GitHub issue
  • Ensures complex token-based paths work correctly

Better Error Messages:

  • Enhanced error handling in SseHttpClientTransportAutoConfiguration.java
  • Clear validation messages explaining proper URL splitting
  • Examples in error messages for quick debugging

Testing

Files Modified

  • auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-common/src/main/java/org/springframework/ai/mcp/client/common/auto
    configure/properties/McpSseClientProperties.java
  • auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-common/src/test/java/org/springframework/ai/mcp/client/common/auto
    configure/properties/McpSseClientPropertiesTests.java
  • auto-configurations/mcp/spring-ai-autoconfigure-mcp-client-httpclient/src/main/java/org/springframework/ai/mcp/client/httpcli
    ent/autoconfigure/SseHttpClientTransportAutoConfiguration.java
  • spring-ai-docs/src/main/antora/modules/ROOT/pages/api/mcp/mcp-client-boot-starter-docs.adoc

Signed-off-by: Mattia Pasetto [email protected]

I am still pretty new to contributions, please double check and let me know of any errors.

Signed-off-by: Mattia Pasetto <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant